<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const str = 'The car parked in the garage.'
      
      // .	句号匹配任意单个字符除了换行符。
      const reg = /.ar/g

      // match 可以查看匹配的结果
      const arr = str.match(reg)

      console.log('字符串', str)
      console.log('正则表达式', reg)
      console.log('匹配结果', arr)
    </script>
  </body>
</html>
